package com.example.demo.mapper;

import com.example.demo.entity.ScRecord;
import com.example.demo.entity.ScShift;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;


@Mapper
@Repository
public interface ScShiftMapper extends BaseMapper<ScShift> {

    @Select("SELECT * FROM sc_shift WHERE is_deleted is false AND `name` IS NOT NULL AND `name` != '' AND `month` = #{date}")
    List<ScRecord> getNameList(String date);

    @Select("SELECT * FROM sc_shift WHERE id IN (SELECT MIN(id) FROM sc_record GROUP BY `name`)")
    List<ScRecord> getNameList1();

}




